package com.pingan.haofang.searchcloud.monitor.domain;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author EX-SUNBIXIAO001
 * @date 2018/10/23
 * @since 1.0.0
 */
@Entity
@Table(name = "t_dashboard_error_sql")
@EntityListeners({AuditingEntityListener.class})
public class DashboardErrorSql {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Column(name = "index_id")
    private Long indexId;//索引id

    @Column(name = "index_name")
    private String indexName;//索引名称

    @Column(name = "project_id")
    private Long projectId;//项目名称id

    @Column(name = "project_name")
    private String projectName;//项目名称

    @Column(name = "sql_")
    private String sql;//项目名称

    @Column(name = "type_")
    private Integer type;//类型，错误sql：1，慢查询sql：2

    @Column(name = "query_time")
    private Date queryTime;//sql查询时间

    @Column(name = "query_cost")
    private Integer queryCost;//sql执行耗时(ms)

    @CreatedDate
    @Column(name = "create_time")
    private Date create_time;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getIndexId() {
        return indexId;
    }

    public void setIndexId(Long indexId) {
        this.indexId = indexId;
    }

    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Date getQueryTime() {
        return queryTime;
    }

    public void setQueryTime(Date queryTime) {
        this.queryTime = queryTime;
    }

    public Integer getQueryCost() {
        return queryCost;
    }

    public void setQueryCost(Integer queryCost) {
        this.queryCost = queryCost;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
}
